package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.PhoneLoginBean
import fhp.hlhj.giantfold.network.UrlApis

/**
 * author: FHP
 * data: on 2018\1\10 0010 14:39
 * E-Mail: 103945089@qq.com
 */
class PhoneLoginModule {
    interface PhoneLoginListener{
        fun showLoading()
        fun phoneLoginOver(phoneLoginBean: PhoneLoginBean)
    }

    fun login(params: HttpParams,listener: PhoneLoginListener){
        UrlApis.phoneLogin(params)
                .doOnSubscribe {
                    listener.showLoading()
                }
                .subscribe {
                    data->
                    listener.phoneLoginOver(data)
                }
    }
}